package homework19;

import java.time.LocalDate;

public class HourlyEmployee extends ColaEmployee {
    double hourMoney;
    double hour;

    public HourlyEmployee(String name, LocalDate birthday, double hourMoney, double hour) {
        super(name, birthday);
        this.hourMoney = hourMoney;
        this.hour = hour;
    }


    void sendMoney(int month) {
        if (getSalary(month) == 1) {
            if (hour > 160)
                System.out.println("工资是" + 150 * hourMoney + (hour - 150) * hourMoney + 100);
            else
                System.out.println("工资是" + hourMoney * hour + 100);
        } else {
            if (hour > 160)
                System.out.println("工资是" + 150 * hourMoney + (hour - 150) * hourMoney);
            else
                System.out.println("工资是" + hourMoney * hour);
        }
    }

}
